package org.jeecg.common.security;

import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.base.service.ISysDictService2;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 需要加密字段
 * @author: qiang.zhou
 * @date: 2024/6/12 11:09
 **/
@Service
public class DataSecurityLoadServiceImpl implements DataSecurityLoadService {

    @Resource
    private ISysDictService2 sysDictService;

    /**
     * 需要加密字段的载入方式
     * @author: qiang.zhou
     * @date: 2024/6/12 11:10
     * @return java.util.List<java.lang.String>
     **/
    @Override
    public List<String> loadSecurityField() {
        List<DictModel> modelList = sysDictService.queryEnableDictItemsByCode2("dataSecurityField");
        return modelList.stream().map(DictModel::getValue).collect(Collectors.toList());
    }

}
